home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
A is for ART, C is for Cezanne
/
A is for ART, C is for Cezanne.iso
/
mac
/
MEDIA
/
CEZANNE.DIR
/
00007_Script_MUSEUM SCRIPTS
< prev
next >
Wrap
Text File
|
1996-05-28
|
12KB
|
337 lines
GLOBAL gScreen, gMainArtList, gPainting, gDot, gBGchan, gMusList, hand ,fist, hdPath
GLOBAL mMover, gWallNo, gPicsOnWall, gBinList, gMaskL,gCursL,gMaskR, gCursR
GLOBAL gWallList1,gWallList2,gWallList3,gWallList4,gWallList5,gBinLocList, gRulerON
--------------------- MUSEUM SCRIPTS ----------------------------------
on setUpMuseumLists
set gCursR = member "cursR" of castLib "MUSEUM"
set gMaskR = member "maskR" of castLib "MUSEUM"
set gCursL = member "cursL" of castLib "MUSEUM"
set gMaskL = member "maskL" of castLib "MUSEUM"
set gMusList = value(line 2 of field "museumInfo" of castLib "USER")
set gBinList = value(line 4 of field "museumInfo" of castLib "USER")
set gWallList1 = value(line 6 of field "museumInfo" of castLib "USER")
set gWallList2 = value(line 8 of field "museumInfo" of castLib "USER")
set gWallList3 = value(line 10 of field "museumInfo" of castLib "USER")
set gWallList4 = value(line 12 of field "museumInfo" of castLib "USER")
set gWallList5 = value(line 14 of field "museumInfo" of castLib "USER")
set gRulerON = EMPTY
end
on enterMuseum
set mMover = 40
set gWallNo = 1
-- set the stretch of sprite 34 = FALSE
setUpBin
changeMuseumRoom
puppetSprite mMover, TRUE
set the constraint of sprite mMover = 2 ---- WallRect
END
on setUpBin
repeat with x = 35 to 37
puppetsprite x, TRUE
set the member of sprite x = gDot
end repeat
set gBinLocList = [point(432,370), point(428,384), point(424,380)]
----- loc of sprite 37 holds position 1 in list, 12 holds 2, etc)
set the cursor of sprite mMover = fist
showBin
end
on showBin
set the cursor of sprite 37 = hand
set the stretch of sprite 37 = 0
set the member of sprite 33 = the number of member "binBack.pic" of castlib "MUSEUM"
set the loc of sprite 33 = point(427, 372)
set the stretch of sprite 33 = 0
set the member of sprite 38 = the number of member "binFront.pic" of castlib "MUSEUM"
set the isOn of (getProp(the btnList of gScreen,18)) = TRUE --binRemBtn
resetBinBtn (getProp(the btnList of gScreen,19)) --remCloseBtn
repeat with x = 37 down to (38 - min(count(gBinList),3))
------ counting up 1,2,3 in list (37-->1,36-->2, 35-->3)
set the loc of sprite x = getAt(gBinLocList, 38-x)
------ counting up 1,2,3 in list (37-->1,36-->2, 35-->3)
set pic = getAt(gBinList,38-x)
set the member of sprite x = the number of member ("BN_"& pic) of castLib "MUSEUM"
end repeat
END
on toggleRuler
if gRulerON = EMPTY then
set gRulerON = "R"
renameBtn getProp(the btnList of gScreen, 16), "rulerOffBtn"
else
set gRulerON = EMPTY
renameBtn getProp(the btnList of gScreen, 16), "rulerBtn"
end if
------ MUS_WR2.PIC or MUS_W2.PIC etc.
set the member of sprite gBGchan = the number of member ("MUS_W" & gRulerON & gWallNo & ".PIC") of castLib "MUSEUM"
end
on changeMuseumRoom
puppetSound member "NEWROOM.AIF" of castLib "MUSEUM"
set thisWallList = value("gWallList" & gWallNo)
set gPicsOnWall = count(thisWallList)
repeat with x = 22 to 31
puppetSprite x, TRUE
set the cursor of sprite x = hand
if (gPicsOnWall < (x-21)) then
set the member of sprite x = gDot
else
set name = string(getPropAt(thisWallList, x-21))
set the member of sprite x = the number of member ("UP_" & name) of castLib "MUSEUM"
set the loc of sprite x = getAt( thisWallList , x-21)
end if
end repeat
------ MUS_WR2.PIC or MUS_W2.PIC etc.
set the member of sprite gBGchan = the number of member ("MUS_W" & gRulerON & gWallNo& ".PIC") of castLib "MUSEUM"
end
on removeFromMuseum
if the member of sprite 37 = gDot then exit
set picNo = chars (the name of the member of sprite 37, 4,7) -- BN_P1
set the member of sprite 37 = gDot
deleteOne(gBinList, picNo)
updateStage
if count(gBinList) > 0 then
------ move loc in binLocList from 1 to new position after back picture
addAt(gBinLocList, min(4,(count(gBinList)+2)),getAt(gBinLocList,1))
deleteAt(gBinLocList,1)
end if
moveBinPicsForward
set num = getPos(gMusList,value("#"&picNo))
deleteAt(gMusList,num)
set the inMuseum of (getProp(gMainArtList,value("#"&picNo))) = FALSE
end
on dragToWall spriteNum
set picNo = chars (the name of the member of sprite spriteNum,4,7) -- BIN_P1
cursor fist
holdON 8
if NOT the stillDown then
cursor hand
puppetSound "splodge.aif"
updateStage
moveFrontToHOLD picNo
moveBinPicsForward
moveHOLDtoBack
else
set the cursor of sprite spritenum = fist
removeFromBin picNo
dragAround mMover
if gPicsOnWall < 10 AND NOT withinBin() then -- sprite 2 = wallRect, 33 = binBack / rollover(2) AND
shiftBinLocsForward
moveBinPicsForward
placeOnWall picNo
else
returnToBin picNo
end if
set the member of sprite mMover = gDot
set the cursor of sprite spritenum = hand
end if
cursor hand
END
on withinBin
if rollover(33) OR (sprite mMover within 33) then return TRUE
else return FALSE
end
on removeFromBin picNo
set the loc of sprite mMover = point(the mouseH, the mouseV)
set the member of sprite mMover = the number of member ("UP_"&picNo) of castLib "MUSEUM"
set the member of sprite 37 = gDot
------ remove from BinList
deleteOne(gBinList, picNo)
-- updateStage
END
on moveFrontToHOLD picNo
if count(gBinList) >1 then --there is something to move
------ change BinList
deleteAt(gBinList,1)
add(gBinList, picNo)
------ change binLocList
addAt(gBinLocList, min(4,(count(gBinList)+1)),getAt(gBinLocList,1))
deleteAt(gBinLocList,1)
end if
END
on moveHOLDtoBack
if count(gBinList) < 4 then
------ show in back of bin
set num = count(gBinList)
set picNo = getAt(gBinList,num)
set the member of sprite (38- num) = the number of member ("BN_"&picNo) of castLib "MUSEUM"
set the loc of sprite (38-num) = getAt(gBinLocList,num)
end if
END
on shiftBinLocsForward
------ move loc in binLocList from 1 to new position after back picture
if count(gBinList) > 0 then
------ add 2 to account for 1 to be deleted and 1 to go* behind* last pic
addAt(gBinLocList, min(4,(count(gBinList)+2)),getAt(gBinLocList,1))
deleteAt(gBinLocList,1)
end if
end
on moveBinPicsForward
--list already adjusted by placeOnWall or moveFrontToHOLD
set howMany = count(gBinList)
if howMany > 0 then
repeat with x = 1 to min(3, howMany)
set the loc of sprite (38-x) = getAt(gBinLocList,x) --the loc of sprite (37-x)
set the member of sprite (38-x) = the member of sprite (37-x)
------ potentially uses the member of sprite 34, temporarily, for sprite 35
end repeat
if howMany > 2 then
----- get the next pic from list & show it
set picNo = getAt(gBinList,3)
set the member of sprite 35 = the number of member ("BN_"&picNo) of castLib "MUSEUM"
set the loc of sprite 35 = getAt(gBinLocList,3)
else
----- hide the back sprite, set back sprite to new loc
set the member of sprite (37-howMany) = gDot
end if
end if
END
on dragAround chan
-- set the cursor of sprite chan = fist
puppetSprite 2, true
set the stretch of sprite 2 = TRUE
set the height of sprite 2 = (434 - (the height of the member of sprite chan)/2)
set the constraint of sprite chan = 2 --wallRect
updateStage
repeat while the mouseDown
set the loc of sprite chan = point(the mouseH, the mouseV)
updateStage
end repeat
-- set the constraint of sprite chan = 0 --none
set the stretch of sprite 2 = FALSE
puppetSprite 2, false
END
on placeOnWall picNo
----- wall sprites begin at 22
set gPicsOnWall = gPicsOnWall + 1
set the cursor of sprite (21 + gPicsOnWall) = hand
set the loc of sprite (21 + gPicsOnWall) = the loc of sprite mMover
set the member of sprite (21 + gPicsOnWall) = the member of sprite mMover
------ add to (current) roomList
addProp(value("gWallList"&gWallNo),picNo, the loc of sprite mMover) -- "p1":point(x,y)
------ update gMusList so changeCuration works correctly
deleteOne(gMusList, value("#" & picNo))
addProp (gMusList, value("#"&gWallNo), value("#" & picNo))
END
on moveOnWall chan
set picNo = chars (the name of the member of sprite chan,4,7) -- BN_P1
set the member of sprite mMover = the member of sprite chan
set the loc of sprite mmover = the loc of sprite chan
set the cursor of sprite chan = fist
set the member of sprite chan = gDot
dragAround mMover
if withinBin() then -- sprite 33 = binBack
removeFromWall chan, picNo
moveBinPicsBackward
returnToBin picNo
else
------ revise loc in (current) roomList
set the member of sprite chan = the member of sprite mMover
set the loc of sprite chan = the loc of sprite mMover
setProp(value("gWallList"&gWallNo),picNo, the loc of sprite mmover) -- "p1":point(x,y)
end if
set the cursor of sprite chan = hand
set the member of sprite mMover = gDot
updateStage
END
on removeFromWall chan, picNo
------ move the sprites forward to fill the gap
-- if gPicsOnWall = 0 then beep
repeat with c= chan to (21 + gPicsOnWall)
set the loc of sprite c = the loc of sprite (c+1)
set the member of sprite c = the member of sprite (c+1)
end repeat
set the member of sprite (22 + gPicsOnWall) = gDot
set gPicsOnWall = gPicsOnWall - 1
------ delete from (current) roomList (gWallList1, etc)
deleteProp(value("gWallList"&gWallNo), picNo)
------ update gMusList so changeCuration works correctly
deleteOne(gMusList, value("#" & picNo))
addProp (gMusList, #bin, value("#" & picNo))
-- set the cursor of sprite (22 + gPicsOnWall) = 0
END
on moveBinPicsBackward
------ SHIFT LOC LIST
------ move loc in binLocList last to first
if count(gBinList) > 0 then
----- take the loc at position 3 (last) and add it at position 1, then delete the last
addAt(gBinLocList,1,getAt(gBinLocList,3))
deleteAt(gBinLocList,4)
end if
----- SHIFT PIC SPRITES
set howMany = count(gBinList)
if howMany > 0 then
repeat with x = min(2, howMany) down to 1
------ counting down 3,2,1 in locList (sprite 13--> position 1, etc)
------ e.g. if 2 then set loc of 35 = (getAt pos 3)
set the loc of sprite (37-x) = getAt(gBinLocList,x+1)
------ sets member of backMost sprite first
------ e.g. if 2 then set member of 35 = member of 36, then member of 36 = member of 37
set the member of sprite (37-x) = the member of sprite (38-x)
end repeat
end if
END
on returnToBin picNo
------ add to front of BinList
addAt(gBinList,1, picNo)
set howmany = count(gBinList)
------ show at FRONT of bin
set the member of sprite 37 = the number of member ("BN_"&picNo) of castLib "MUSEUM"
set the loc of sprite 37 = getAt(gBinLocList,1)
END
on musNav dir
repeat while the mouseDown
end repeat
if rollover (the clickon) then
cursor 4
set gWallNo = gWallNo + dir
if gWallNo > 5 then set gWallNo = 1
if gWallNo < 1 then set gWallNo = 5
changeMuseumRoom
end if
-- cursor 0
end
on closeMuseum
repeat with x = 35 to 37
puppetSprite x, FALSE
set the cursor of sprite x = 0
end repeat
repeat with x = 22 to 31
puppetSprite x, FALSE
set the cursor of sprite x = 0
end repeat
set the stretch of sprite 33 = 0
set the constraint of sprite mMover = 0 --none
set the cursor of sprite mMover = 0 --none
end
on SaveMuseumInfoToLib
put gMusList into line 2 of field "museumInfo" of castLib "USER"
put gBinList into line 4 of field "museumInfo" of castLib "USER"
put gWallList1 into line 6 of field "museumInfo" of castLib "USER"
put gWallList2 into line 8 of field "museumInfo" of castLib "USER"
put gWallList3 into line 10 of field "museumInfo" of castLib "USER"
put gWallList4 into line 12 of field "museumInfo" of castLib "USER"
put gWallList5 into line 14 of field "museumInfo" of castLib "USER"
end